
package com.compuvest.admin.chart.xml;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ChartRecord {
    
    public static String DAYS_30 = "31-60";
    public static String DAYS_60 = "61-90";
    public static String DAYS_90 = "91-180";
    public static String DAYS_180 = "181-240";
    public static String DAYS_240 = "241-more";

    private String name;
    private String date;
    private double days30;
    private double days60;
    private double days90;
    private double days180;
    private double days240;
    private double daysMore;

    public ChartRecord() {
    }


    public String getUserName()             { return name; }
    public void setUserName(String name)    { this.name = name;	}

    public String getDate()                 { return date != null ? date : new SimpleDateFormat("yyyy-MM-dd").format(new Date()); }
    public void setDate(String date)        { this.date = date;	}

    public double getDays30()               { return days30; }
    public void setDays30(double days30)    { this.days30 = days30; }

    public double getDays60()               { return days60; }
    public void setDays60(double days60)    { this.days60 = days60; }

    public double getDays90()               { return days90; }
    public void setDays90(double days90)    { this.days90 = days90; }

    public double getDays180()              { return days180; }
    public void setDays180(double days180)  { this.days180 = days180; }

    public double getDays240()              { return days240; }
    public void setDays240(double days240)  { this.days240 = days240; }

    public double getDaysMore()             { return daysMore; }
    public void setDaysMore(double daysMore){ this.daysMore = daysMore; }

    @Override
    public String toString() {
	StringBuilder sb = new StringBuilder();
	sb.append("Chart Details - ");
	sb.append("User: ").append(getUserName());
	sb.append(", date: ").append(getDate());
	sb.append(", 30: ").append(getDays30());
	sb.append(", 60: ").append(getDays60());
	sb.append(", 90: ").append(getDays90());
	sb.append(", 180: ").append(getDays180());
	sb.append(", 240: ").append(getDays240());
	sb.append(", more: ").append(getDaysMore());
	sb.append('\n');
	return sb.toString();
    }
}
